From 9c394f17ff24b024b0bbaa1460903df61b55d6c5 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 30 May 1993 02:44:11 +0000 Subject: [PATCH] (Ficonify_frame, Fmake_frame_invisible): Select some other frame. Move minibuffer off this frame. (Fhandle_switch_frame): Don't call Ffocus_frame. (Fredirect_frame_focus): Call Ffocus_frame here. --- src/frame.c | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/src/frame.c b/src/frame.c index d2e5b081281..93d62cfb83b 100644 --- a/src/frame.c +++ b/src/frame.c @@ -391,15 +391,6 @@ to that frame.") last_nonminibuf_frame = selected_frame; Fselect_window (XFRAME (frame)->selected_window); - - /* I think this should be done with a hook. */ -#ifdef HAVE_X_WINDOWS - if (FRAME_X_P (XFRAME (frame)) - && NILP (no_enter)) - { - Ffocus_frame (frame); - } -#endif choose_minibuf_frame (); /* We want to make sure that the next event generates a frame-switch @@ -832,6 +823,18 @@ If omitted, FRAME defaults to the currently selected frame.") CHECK_LIVE_FRAME (frame, 0); + /* Don't let the frame remain selected. */ + if (XFRAME (frame) == selected_frame) + Fhandle_switch_frame (next_frame (frame, Qt), Qnil); + + /* Don't allow minibuf_window to remain on a deleted frame. */ + if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window)) + { + Fset_window_buffer (selected_frame->minibuffer_window, + XWINDOW (minibuf_window)->buffer); + minibuf_window = selected_frame->minibuffer_window; + } + /* I think this should be done with a hook. */ #ifdef HAVE_X_WINDOWS if (FRAME_X_P (XFRAME (frame))) @@ -853,6 +856,18 @@ If omitted, FRAME defaults to the currently selected frame.") CHECK_LIVE_FRAME (frame, 0); + /* Don't let the frame remain selected. */ + if (XFRAME (frame) == selected_frame) + Fhandle_switch_frame (next_frame (frame, Qt), Qnil); + + /* Don't allow minibuf_window to remain on a deleted frame. */ + if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window)) + { + Fset_window_buffer (selected_frame->minibuffer_window, + XWINDOW (minibuf_window)->buffer); + minibuf_window = selected_frame->minibuffer_window; + } + /* I think this should be done with a hook. */ #ifdef HAVE_X_WINDOWS if (FRAME_X_P (XFRAME (frame))) @@ -971,6 +986,13 @@ The redirection lasts until `redirect-frame-focus' is called to change it.") XFRAME (frame)->focus_frame = focus_frame; + /* I think this should be done with a hook. */ +#ifdef HAVE_X_WINDOWS + if (!NILP (focus_frame) && ! EQ (focus_frame, frame) + && FRAME_X_P (XFRAME (focus_frame))) + Ffocus_frame (focus_frame); +#endif + if (frame_rehighlight_hook) (*frame_rehighlight_hook) (); -- 2.30.2